how to get the magnitude of a vector